package yxy.cherry.battle.module;

import yxy.cherry.battle.suppression.Suppression;
import yxy.cherry.data.bean.herodata;
import yxy.cherry.data.bean.heroadvanced;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

/** 战斗数据 仅提供初始化数据 不参与变量 */
public class FighterData {

	String name;
	Gender 性别;
	Camp 阵营;

	Set<Suppression> 克制效果 = new HashSet<>();

	int heroId;
	int 等级;
	int 星级;
	int 怒气上限 = 1;
	int 初始怒气 = 0;
	int 发怒阈值 = 1;
	int 怒气增长值;
	PropertyData propertyData;// 属性

	long power;

	public FighterData(PropertyData propertyData,String name){
		this.propertyData = propertyData;
		this.name = name;
	}

	public FighterData(herodata _herodata, heroadvanced _heroadvanced, int 等级, int 阶数, int 星级, int 初始怒气, long 战力, PropertyData propertyData,
					   Collection<String> skills) throws Exception {
		this.name = _herodata.getName();
		this.heroId = _herodata.getId();
		this.等级 = 等级;
		this.星级 = 星级;
		this.阵营 = Camp.forNumber(_herodata.getPower());
		this.性别 = _herodata.getGender() == 1 ? Gender.男 : Gender.女;
		this.怒气增长值 = _herodata.getIncreaselanger()[0];
		this.怒气上限 = _herodata.getPvelangermax();
		this.发怒阈值 = _herodata.getFullanger();
		this.初始怒气 = 初始怒气;
		this.propertyData = propertyData;
		this.power = 战力;

		for (int i = 0; i < _herodata.getParameter().length; i++) {
			Suppression suppression = Suppression.create(_herodata.getParameter()[i], _herodata.getAttribute()[i], _herodata.getNum()[i]);
			if (suppression != null) {
				克制效果.add(suppression);
			}
		}
	}

	public PropertyData getPropertyData() {
		return propertyData;
	}

	public int get初始怒气() {
		return 初始怒气;
	}

	public int get怒气上限() {
		return 怒气上限;
	}

	public int get发怒阈值() {
		return 发怒阈值;
	}

	public Gender get性别() {
		return 性别;
	}

	public Camp get阵营() {
		return 阵营;
	}

	public Collection<Suppression> get克制效果() {
		return 克制效果;
	}

	public int get等级() {
		return 等级;
	}

	public int get星级() {
		return 星级;
	}

	public int get怒气增长值() {
		return 怒气增长值;
	}

	public String getName() {
		return name;
	}

	public int getDataId() {
		return heroId;
	}

	public long getPower() {
		return power;
	}
}
